package cc.git.liuyan;

import cc.git.other1.T1;
import cc.git.other2.T2;

import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
        String name = runtimeMXBean.getName();
        System.out.println("进程名称: " + name);
        // 提取进程ID
        String pid = name.split("@")[0];
        System.out.println("进程ID: " + pid);

        while (true) {
            Thread.sleep(2000L);
            System.out.println("Hello, World!");
            Thread.sleep(2000L);
            T1.print1();
            T1.print2("111111");
            T1 t1 = new T1();
            T2 t2 = new T2();
            t2.print1();
            t2.print2("222222");
        }
    }
}